<script src="/statics/js/pingpp.js" type="text/javascript"></script>
<!-- 头部开始 -->
<div class="header">
<!--    <div class="header_r"><img src="img/tx.jpg" width="30"></div>-->
    <div class="header_l"><a href="/order/slist/sek/<?=$sek?>"></a></div>
    <div class="header_m">订单支付</div>
</div>
<!-- 头部结束 -->

<!--店铺基本信息开始-->
<div class="tixian">
    <ul>
        <li><a href="#"><span>¥<?=$orderData['order_amount']-$orderData['order_express']-$orderData['order_taxes']?></span>商品总额</a></li>
        <li><a href="#"><span>¥<?=$orderData['order_discount']?></span>优惠</a></li>
        <li><a href="#"><span>¥<?=$orderData['order_taxes']?></span>税费</a></li>
        <li><a href="#"><span>¥<?=$orderData['order_express']?></span>运费</a></li>
        <li><a href="#"><span>¥<?=$orderData['order_amount']?></span>需付</a></li>
    </ul>
</div>
    <div class="pay-ok"><button id="putPay">确认支付</button></div>
<!--店铺基本信息结束-->

<!--<div class="fiex nav"> <a class="icon-shouye fiex_on" href="/index/index/sek/<?=$sek?>"><br />-->
  <!--首页</a> <a class="icon-fenlei" href="/cate/main/sek/<?=$sek?>"><br />-->
  <!--分类</a> <a class="icon-gouwu" href="/cart/index/sek/<?=$sek?>"><br />-->
  <!--购物车</a> <a class="icon-geren" href="/index/user/sek/<?=$sek?>"><br />-->
  <!--用户中心</a> </div>-->
<script src="/statics/js/layer.js"></script>
<script>
$(function(){
	mm = 1;
	$('#putPay').click(function(){
		if(mm == 0){
			return false;
		}
		mm = 0;
		$.post('/pay/payInit',{'order_id':'<?=$orderData['order_id']?>','money':'<?=$orderData['order_amount']?>','channel':'wx_pub'},function(data){
			if(data.code == '1'){
				pingpp.createPayment(data.data, function(result, error){
				    if (result == "success") {
				    	layer.msg('支付成功', {icon: 1});
				    	setTimeout(function(){window.location = '<?=$orderData['order_type'] > 0 ? "/saler/index" : "/order/slist"?>';},500);
				    } else if (result == "fail") {
				    	layer.msg('系统取消支付', {icon: 0});
				    } else if (result == "cancel") {
				    	layer.msg('用户取消支付', {icon: 0});
				    }
				    mm = 1;
				});
			}else{
				exit('error111');
			}
		},'json');
	});
})
</script>